<%@ page import="dao.*" %>
<%@ page import="proto.*" %>
<%@ page import="java.sql.SQLException" %><%--
  Created by IntelliJ IDEA.
  Usererver附加数据库: Superb
  Date: 2022/10/18
  Time: 13:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>admin</title>
    <style>
        @import "css/button.css";
        input{
            font-size: 15px;
            width: 190px;
        }
        body{
            background-image: url("./images/1-1.jpg");
            background-size: cover;
        }
        .back{
            background: #fffcee;
            margin: auto;
            border-radius: 20px;
            width: 576px;
            top:0;
            height: 100%;
        }
        .label{
            width: 300px;
            margin: auto;
        }
    </style>
</head>
<body>
<div class="back">
    <%int admin = Integer.parseInt(request.getParameter("admin"));%>
    <div id="head">
        <form action="${pageContext.request.contextPath}/returnServlet">
            <input type="hidden" name="admin" value="<%=admin%>">
            <button type="submit" class="button_return" style="vertical-align:middle"><span>返回</span></button>
        </form>
    </div>

    <br/><br/><br/>
    <p style="letter-spacing: 10px; font-size: 25px; text-align: center;color:  dodgerblue"><strong>个人信息主页</strong></p><br/><br/>
    <%
        adminDao ad = new adminDao();
        admin a = null;
        try {
            a = ad.Search(admin);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        assert a != null;
    %>
    <div class="label" style="font-size: 15px">
        <form name="admin" action="${pageContext.request.contextPath}/adminServlet">
            <input type="hidden" name="admin" value="<%=admin%>">
            <label style="letter-spacing: 5px">id:</label>&emsp;&emsp;&emsp;&emsp;&emsp;<%=admin%><br/><br/>
            <label style="letter-spacing: 5px">名字:</label><input style="float: right" type="text" name="name" value=<%=a.get_name()%>><br/><br/>
            <label style="letter-spacing: 5px">权限:</label>&emsp;&emsp;&emsp;&emsp;<%=(a.get_status()==1?"总管理员":"管理员")%><br/><br/>
            <label style="letter-spacing: 5px">邮箱:</label><input style="float: right" type="text" name="phone" value=<%=a.get_phone()%>><br/><br/>
            <label style="letter-spacing: 5px">密码:</label><input style="float: right" type="text" name="pwd" value=<%=a.get_password()%>><br/><br/><br/>
            <div style="text-align: center">
                <button type="submit" class="button1" onclick="alert('已更改！')">更改</button>
            </div>
        </form>
    </div>
</div>

</body>
</html>